<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class AdminPermission extends Model
{
    //白名单
    protected $fillable = ['name','description'];
    //权限属于哪个角色
    public function roles()
    {
        return $this->belongsToMany('App\Models\AdminRole','admin_permission_role','permission_id','role_id')->withPivot([
            'permission_id','role_id'
        ]);
    }
}
